package com.yan.job;

import com.yan.domainjob.*;

public class Test5 {
    public  boolean equal(Graphic area1, Graphic area2){
        if(area1.getArea() == area2.getArea()){
            return true;
        } else {
            return false;
        }
    }

    public Graphic maxArea(Graphic graphic1 , Graphic graphic2){
        if(graphic1.getArea() >= graphic2.getArea()){
            return graphic1;
        }else{
            return graphic2;
        }
    }
    public static final Test5 get = new Test5();

    public static void main(String[] args) {
        Circle circle = new Circle(4);
        Rectangle rectangle = new Rectangle(3,4);
        Triangle triangle = new Triangle(3,4,5);
        boolean equals = get.equal(circle, rectangle);
        if(equals){
            System.out.println("两个图形面积相等");
        }else{
            System.out.println("两个图形面积不相等");
        }
        Graphic maxArea = get.maxArea(rectangle, circle);
        System.out.println(maxArea.getInfo() + "---面积最大为:" + maxArea.getArea());
    }
}
